{
  {% if inventory_hostname.startswith("h") %}
  "datacenter": "nyc1",
  {% else %}
  "datacenter": "nyc1",
  {% endif %}
  "data_dir": "/opt/consul",
  "log_level": "INFO",
  "log_file": "/var/log/consul/consul.log",
  "enable_syslog": true,
  "retry_join": [{{ consul_manager_ip.stdout|trim }}],
  {% if inventory_hostname.startswith("hdb") and inventory_hostname|regex_replace("\-?\d+", "") not in ["hdb-mongo-analytics", "hdb-sentry"] %}
  "advertise_addr": "{% raw %}{{ GetAllInterfaces | include \"name\" \"^enp\" | include \"flags\" \"forwardable|up\" | attr \"address\" }}{% endraw %}",
  {% else %}
  "advertise_addr": "{% raw %}{{ GetAllInterfaces | include \"name\" \"^eth\" | include \"flags\" \"forwardable|up\" | attr \"address\" }}{% endraw %}",
  {% endif %}
  "bind_addr": "0.0.0.0",
  "ui_config": {"enabled": true},
  "dns_config": {
    "service_ttl": {
      "*": "300s"
    },
    "node_ttl": "300s"
  }
}
